package cn.com.xjnt.vas.ordering.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.frameworks.core.repository.BaseRepository;
import com.frameworks.core.service.AbstractBaseService;

import cn.com.xjnt.vas.ordering.domain.entity.Department;
import cn.com.xjnt.vas.ordering.domain.entity.Hospital;
import cn.com.xjnt.vas.ordering.repository.DepartmentRepository;
import cn.com.xjnt.vas.ordering.service.DepartmentService;

/** 
* 类说明：
* @author 作者 LUXIN
* @version 创建时间：2016年5月6日18:48:26
*/
@Service
@Transactional
public class DepartmentServiceImpl extends AbstractBaseService<Department, Long> implements DepartmentService {
    @Autowired
    private DepartmentRepository departmentRepository;
    
    @Override
    protected BaseRepository<Department, Long> getBaseRepository() {
        return departmentRepository;
    }

    @Override
    public void save(Department entity) {
        super.saveOrUpdate(entity);
    }

    @Override
    public void update(Department entity) {
        super.saveOrUpdate(entity);
    }

    @Override
    public Department getByCardno(String cardno) {
        return departmentRepository.getByCardNo(cardno);
    }

    @Override
    public List<Department> findByHospital(Hospital hospital) {
        return departmentRepository.findByHospital(hospital);
    }
}
 